Automatic focus control device for use in a camera system

ABSTRACT

In an automatic focus detection device for use in a camera, a focus condition detecting unit detects a focus condition of a photographic lens in a camera based on the output of a light receiving device and calculates the amount of defocus of the photographic lens. An auxiliary light emitting device emits auxiliary light and comparator compares the stored output of memory and the output of the light receiving device under the ambient light; and then the detected defocus amount under the auxiliary light emission is corrected in accordance with the result of comparison so as to eliminate the bad effect of the color aberration of the lens of the camera, whereby a correct focus position can be detected.

This application is a continuation, divisional, of application Ser. No.082,095, filed Aug. 5, 1987 (now abandoned).

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to an automatic focus control device foruse in a camera system, more particularly, to an automatic focus controldevice having an auxiliary light source for radiating auxiliary light toan object in case of low brightness and/or low contrast of the object.

2. Description of Prior Art

There is provided a camera system comprising an automatic focus controldevice which detects a focus condition such as the amount of defocus andthe direction of defocus in accordance with a light passing through aphotograph lens of the camera from an object to be focus controlled, andcontrols an automatic focus adjustment in accordance with a result ofthe focus condition detection. In this sort of automatic focus controldevice, it is possible to detect an in-focus position correctly, whenthe amount of defocus or a defocus value, corresponding to a differencequantity between a current position and an in-focus position of aphotograph lens of the camera, is only within an available range of thefocus detection. On the other hand, it is impossible to detect thein-focus position when the defocus value is out of the detectionavailable range, in this case, a low contrast search control isperformed as follows. That is, the focus condition is detected movingthe photograph lens into another position, and the in-focus position ofthe object is detected when the photograph lens is positioned in thedetection available range.

Conventionally, there are known focus detecting device in which anauxiliary light is radiated to an object to be focus detected from anauxiliary light source so as to detect the correct focus condition underthe low brightness of the object.

Besides, a photographic lens has a color aberration which is adisplacement of the focus position due to wave length of light. In casethe focus detection is made using an infra red or a red auxiliary lightthere occurs a difference of the focus position due to the coloraberration between a focus position with the light wave length of theauxiliary light for the focus detection and a focus position with areference wave length of the ambient light for the photographing.

To compensate the difference of the focus detection, Japanese laid openpatent No. 43620/1985 proposes a focus detecting device which enables toobtain a correct focus position by using a property that the aberrationon a lens axis changes linearly within a wave length range includinginfra red light. In the proposed arrangement, one or more data of thecolor aberrations on the lens axis in a specific wave length is storedin a register of the focus detecting device, then the color aberrationof the wave length of the light used for the focus detection is obtainedbased on the stored color abberation data, the specific wave length, thewave length of the light at the time of focus detection and thereference wave length. Thus a focus position obtained by the measurementusing the auxiliary light is subtracted by the obtained color aberrationso that a correct focus position can be obtained.

However, in the above method, there must be provided optical filters onthe respective optical systems of either the auxiliary light emittingside and light receiving side. Furthermore, there must be provided anarrangement of switching light filters in the light receiving opticalsystem corresponding in accordance with the focus detection underambient light and under auxiliary light. Hence, the device becomescomplicated and expensive.

There is disclosed in Japanese Laid Open Patent publication No.59413/1983 another focus detection device in which the difference of thefocus positions between the ambient light and the infra red light by acalculation Δd X (color aberration of the infra red light)/(coloraberration of the ambient light) so that a correct automatic focus canbe obtained under any light having any wave length. Δd represents thedifference of the focus position between the ambient light of a specificwave length and infra red light.

In the arrangement, there must be provided another set of lightreceiving element and its connecting terminals for deriving the signalfrom the light receiving element in addition to the light receivingelement for detecting the contrast of the object, whereby thearrangement is not suitable to decrease the size of the arrangement andproduction cost. Moreover, there occurs an excessive correction for anoutput of the photosensor array of the automatic focus control in caseof the object with a high contrast and low output for the ambient lightand a low contrast and high output for the infra red light.

SUMMARY OF THE INVENTION

An essential object of the present invention is to overcome theaforementioned problems and to provide an automatic focus control deviceusing an auxiliary light source which is able to detect the focalcondition correctly with a high accuracy and low cost.

According to the present invention, there is provided an automatic focuscontrol device comprising;

a focus detecting means for detecting focus condition of a photographiclens and calculating an amount of defocus by output of light receivingmeans which receives light passing through the photographic lens;

an auxiliary light emitting means for emitting auxiliary light;

comparing means for comparing the output of the light receiving meansunder only the ambient light and the output of the light receiving meansunder the auxiliary light emission and ambient light; and

means for correcting the detected defocus amount under the auxiliarylight emission in accordance with the result of the comparison.

According to the present invention, since the displacement of the focalposition of the photographic lens is corrected by the color aberrationof the photographic lens, in case the focal detection is performed usingan auxiliary light which is added to the ambient light, the correctfocal value can be obtained.

Moreover, there is no need to change filters mounted to the respectiveoptical system therefore, operation of the automatic focus controldevice becomes simple and the manufacturing cost may be decreased sincethe arrangement for changing the filter is unnecessary.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic diagram of an automatic focus camera of apreferred embodiment according to the present invention,

FIGS. 2A and 2B are schematic diagrams of a control circuit of theautomatic focus camera shown in FIG. 1,

FIGS. 3A to 3F are flow charts showing a control operation of the firstpreferred embodiment of the control circuit shown in FIGS. 2A and 2Baccording to the present invention,

FIGS. 4 and 5 are flow charts showing control operations during a ΔIRcorrection of the control circuit shown in FIGS. 2A and 2B,

FIGS. 6A to 6C are flow charts showing a control operation during a lowcontrast searching of the control circuit shown in FIGS. 2A and 2B,

FIG. 7 is a flow chart showing a control operation of the controlcircuit shown in FIGS. 2A and 2B when an INT3 interruption occurs,

FIG. 8 is a timing chart showing timings of a CCD integration of thecontrol circuit shown in FIGS. 2A and 2B,

FIGS. 9A to 9C are graphs showing a distance measurement range duringthe automatic focus operation,

FIGS. 10 and 11 are schematic diagrams showing a principle of focuscondition detection,

FIG. 12 is a schematic diagram showing a reference portion and ameasurement portion of a CCD image sensor FLM shown in FIG. 2A,

FIG. 13 is a schematic diagram showing a color aberration due to thedifference of the wave length,

FIGS. 14 and 15 are respectively schematic diagrams showing amounts ofthe color aberration on a lens axis for various wave lengths, and

FIG. 16 is a graph showing spectral response ratio in the focusdetecting system, and

FIGS. 17 to 19 are flow charts showing an operation of anotherembodiment of the present invention.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Principle of automaticfocus control

First of all, the principle of the automatic focus control will bedescribed below in details. "Automatic focus" is referred to hereinafteras AF. FIGS. 10 and 11 show an optical system of a focus conditiondetecting device for the automatic focus control. In FIG. 10, pencils oflight rays of the object passing through the first and the secondportions 2a and 2b of a photograph lens 2 symmetrical with respect tothe optical axis 18 are reimaged to form two images. By determining thecorrelation between the two images, the amount of defocus and thedirection of defocus from an expected focal point are measured.

A condenser lens 6 positioned behind the photograph lens 2 is arrangedat the expected focal point plane 4, or behind the expected focal pointplane 4. Image reformation lenses 8 and 10 positioned behind thecondenser lens 4 are positioned symmetrically to the optical axis 18 ofthe photograph lens 2. A linear image sensors 12a and 12b such as chargecoupled device (referred to hereinafter as CCD) are arrangedrespectively at the image formation plane of the image reformation lens8 and 10.

In FIG. 11, a piece of the image sensor 12 is used as the aforementionedtwo image sensors 12a and 12b for the convenience of explanation.

When the image of the object is formed at the expected focal point plane4 (referred to hereinafter as in-focus condition), the distance betweenthe two images formed on the image sensor 12 becomes a distancepredetermined by the optical system for the focus condition detection.When the image of the object is formed at the forward position from theexpected focal point surface 4 (referred to hereinafter as forward focuscondition), the images I' and II" formed on the image sensor 12 are nearthe optical axis 18, resulting in that the distance between the imagesI' and II' is smaller than the aforementioned distance of the expectedin-focus condition. On the other hand, When the image of the object isformed behind the expected focal point surface 4 (referred tohereinafter as backward focus condition), the images I" and II" formedon the image sensor 12 are far from the optical axis 18, resulting inthat the distance between the images I" and II" is larger than theaforementioned distance of the expected in-focus condition. Therefore,the focus condition of the object can be judged by detecting thedistance between the images I and II formed on the image sensor 12.

The calculation of the distance required for moving the lens to theposition of the expected focal point, i.e., the defocus value DF will bedescribed below in details.

FIG. 12 shows pixel of the image sensor 12. In FIG. 12, the image I isformed on pixel A0 to An of a reference portion of the image sensor 12by the image reformation lens 8, and the pixel A0 to An of the imagesensor 12 output pix signals Ia0 to Ian respectively. On the other hand,the image II is formed on pixel B0 to Bn+8 of a measurement portion ofthe image sensor 12 by the image reformation lens 10, and the pixel B0to Bn+8 of the image sensor 12 output pix signals Ib0 to Ibn+8respectively. It is detected, which portion of the image I formed on thereference portion of the image sensor 12 mostly corresponds to orcoincides with a portion of the image II formed on the measurementportion of the image sensor 12. By detecting the distance between thedetected portion of the image I and the corresponding portion of theimage II, the defocus value can be calculated from the distance betweenthe images I and II. The calculation of the defocus value will bedescribed below in details.

Each of the pix signal of 9 pairs of the pix signals (Ib0 to Ibn), (Ib1to Ibn+1), ---, (Ibn to Ibn+8) outputted from 9 pairs of the pixel (B0to Bn), (B1 to Bn+1), --- , (Bn to Bn+8) of the measurement portion ofthe image sensor 12 is respectively compared in order with each of apair of the pix signals (Ia0 to Ian) outputted from the pixel (A0 to An)of the reference portion of the image sensor 12, and it is detectedwhich pair of the pix signals of the measurement portion of the imagesensor 12 mostly corresponds to a pair of the pix signals (Ia0 to Ian)of the reference portion of the image sensor 12. The detection can beperformed, for example, by the following procedure.

For 9 combinations (j=0 to 8) corresponding to 9 pairs of pix signals(Ib0 to Ibn), (Ib1 to Ibn+1), ---, (Ibn to Ibn+8) outputted from 9 pairsof the pixel (B0 to Bn), (B1 to Bn+1), --- , (Bn to Bn+8) of themeasurement portion of the image sensor 12, the following values Fj arecalculated. ##EQU1##

Next, the minimum value Fjmin of 9 values Fj is obtained, and a pair ofthe pixel of the measurement portion of the image sensor 12corresponding to Fjmin is obtained, resulting in that the pix signalsoutputted from the obtained pair of the pixel of the measurement portionof the image sensor 12 mostly corresponds to the pix signals outputtedfrom the pixel of the reference portion of the image sensor 12.

For example, if the pix signals Ib4 to Ibn+4 mostly corresponds to thepix signals Ia0 to Ian respectively, the distance between a pair of thepixel (B4 to Bn+4) and the pixel A0 to An can be calculated as thedistance between the images I and II formed on the image sensor 12. Ifthe pix A0 is a the pix of the image sensor 12 and the pix B0 is b thepix of the image sensor 12, the number of the pixel is (b+4-a).Therefore, the distance between the images I and II is calculated by thefollowing equation.

    lx=(b+4-a)×d                                         (1)

where d is a pitch between the pixel of the image sensor 12.

If the distance between the images I and II is l0 in design on thein-focus condition, the defocus value DF is calculated by the followingequation.

    DF=K×{(b+4-a)×d-l0}                            (2)

where K is a constant of the optical system of the focus conditiondetecting device.

The above defocus value DF includes the information of the direction ofdefocus. DF=0 represents the in-focus condition, the positive value DFrepresents the backward focus condition, and the negative value DFrepresents the forward focus condition. The available range of thedefocus value DF which can be detected by the above calculation is asfollows. ##EQU2##

The defocus value DF can be calculated in the above range (3) in thedistance measurement, and the range (3) is referred to hereinafter asdefocus cover range.

The method for calculating the distance between the images I and II morecorrectly by detecting the corresponding relationship between the imagesI and II formed on the image sensor 12 is disclosed in details in theJapanese patent laid open Nos. 126517/1984 and 4914/1985 by theapplicant of the present invention. The method is not described in thisspecification because the subject matter of the present invention is notpertinent thereto.

A contrast value C, a correlation level value YM, and a peak value P ofthe pix signal used for the judgment of a reliability of the defocusvalue DF and the judgment of lighting or emission of an auxiliary lightwill be described below in details.

The peak value P of the pix signal is defined by the following equationas the maximum value of the pix signals Ia0 to Ian outputted from thepixel of the reference portion of the image sensor 12 used forcalculating the above defocus value DF.

    P=max {Ia0, Ia1, ---, Ian}                                 (4)

The contrast value C is defined by the following equation. ##EQU3##

The correlation level value YM is defined by the following equation.

    YM=Hmin/C                                                  (6)

where

    Hmin=min{H(1), H(2), ---, H(9)}                            (7)

and H(l) is defined as a correspondence function by the followingequation. ##EQU4##

    l=1, 2, ---, 9                                             (8)

The correlation level value YM is a normalized function by the contrastvalue C, because the correspondence function H(l) is depend on thecontrast value C. The correlation level value YM can be obtained as theunit of the pitch between the pixel of the image sensor 12, however, inpractical, the correspondence function often becomes a minimum value atthe middle position between the pixel. Therefore, the interpolationcalculation can be performed in order to obtain a position lmin wherethe minimum value Hmin of the correspondence function H(l) reallybecomes a minimum value. Moreover, the correlation level value YM can bemore correctly obtained by using the above real minimum value lmin. Theabove interpolation calculation method is described in the Japanesepatent laid open No. 126517/1984 by the applicant of the presentinvention, and the method is not described in this specification,because the method is not the subject matter of the present invention.

It is referred to hereinafter as low contrast condition, when the peakvalue P of the pixel is smaller than a predetermined threshold value orthe object is dark, when the contract value C is smaller than apredetermined threshold value or the object is in a low contract, orwhen the correlation level value YM is larger than a predeterminedthreshold value. In the case of the low contrast, the reliability of thedefocus value DF is reduced.

A way of correction to the error of the focus position due to the coloraberration of the photographic lens in case of focus detection when theauxiliary light is radiated to the object will be described below indetails.

As well known, the focal position of the light passed the photographiclens differs corresponding to the wave length of the light. For example,as shown in FIG. 13, the focal position of a standard light (shown by d)having 587 nm wave length, for example, focuses at a position nearer tothe photographic lens than the light c existing at the infra red region.In a similar manner the focal position of the light (shown by e) havinga shorter wave length than that of the light d is situated nearer to thephotographic lens than the light d.

FIG. 14 shows a manner of change of the color aberration on the lensaxis of the lens made of abnormal dispersion glass or fluorite.

FIG. 14 shows how long the focal positions of various lights aredisplaced from the focal position of the light d (587 nm) when thelatter is focused. Apparent from FIG. 14, the color aberration islinearly increased in the range of the wave length longer than 500 nm.Such property can be seen in case of any conventional lenses. However,the amount of color aberration on the axis is different for the variouslenses. The gradient of the linear part of the property of the coloraberration on the axis is also different for each lens.

In case of a photographic lens having a property of color aberration onthe lens axis as shown in line A in FIG. 15, with the light d (587 nm)focused, when the focus detection is made with the auxiliary lighthaving the wave length λ, there occurs difference ΔIRλ of the focalposition. The value of ΔIRλ can be obtained by an equation

    ΔIRλ=ΔIR.sub.800 X (λ-λd)/(800-λd)(9)

assuming that the color aberration ΔIR₈₀₀ on the axis of the light ofwave length of 800 nm is known.

λd is the wave length of 587 nm.

The spectral response ratio of the focal detection system is required awide range as shown in FIG. 16 so that the detection system is operableagainst the ambient light and auxiliary light. Therefore, in case thefocal detection is made in a complete dark where the ambient lightcomponent is zero, the correction by the equation (9) can be madecorrectly. However, in case there is any ambient light, the focaldetection is made by the light which is the mixture of the auxiliarylight and ambient light, so that there occurs an error. As shown in FIG.16, both of the auxiliary light component and ambient light componentare detected in the spectral response of the focal detecting system. InFIG. 16, an example of ambient light component is shown by the dottedlines. Thus there occurs an error ΔIRλmix which is displaced from ΔIRλby ΔIRλ-ΔIRλ mix. In order to correct the error, there may be proposedto correct the error using a ratio of the intensity of the ambient lightand the intensity of auxiliary light contained in the mixed light. Thefocal detection depends on the amount of change of the light intensityof the object i.e., the contrast of the object, but is not affected bythe intensity of the light. Therefore, in case the light intensity ofthe object is proportional to the contrast of the object, it is possibleto correct the error using the method mentioned above. However, in casethe contrast is not proportional to the light intensity of the object,there occurs an error in the focal detection. Namely, in case the thespectral response ratio is different for the wave length of theauxiliary light and for the wave length of the ambient light or contrastpattern is used as the auxiliary light, there occurs an error. In such acase, a correction can be made by obtaining the contrast of the ambientlight component in the mixed light and the contrast of the auxiliarylight component in the mixed light. For example, assuming the contrastof the object Cdl under the ambient light without the auxiliary lightand the contrast of the object Cmix under the mixed light with theauxiliary light, in case of dark, Cdl=0 and Cdl/Cmix=0. In this case,the displacement of the focal position from the focal position for thestandard light can be calculated by equation (9) with the result ofΔIRλ.

In case of the auxiliary light component is zero even if the auxiliarylight is radiated to the object which may occur the object is situatedat the infinite point, Cdl=Cmin or Cdl/Cmin=1 is obtained. Thus thefocal position for the auxiliary light is equivalent to the focalposition for the standard light and the error is zero.

By approximating the change of the value ΔIRλ is linear in the rangebetween Cdl/Cmix=0 to Cdl=1,

    ΔIRλmix=≢IRλX (b 1-Cdl/Cmix)  (10)

can be obtained. Thus an accurate focal position can be obtained bycorrecting the detected focal position by the result of the equation(9).

Construction of automatic focus camera

An automatic focus camera of a preferred embodiment according to thepresent invention will be described below in details.

FIG. 1 shows the whole construction of the automatic focus camera. InFIG. 1, the portion surrounded by a chain line is a main body BD of thecamera. At the left side of the main body BD of the camera, a zoom lensLZ which is one example of various kinds of interchangeable lenses isdetachably mounted on the main body BD. An electric flash device FSenclosing an auxiliary light device AL is detachably mounted on the topsurface of the main body BD.

The zoom lens LZ is mechanically connected to the main body BD by clutchmembers 106 and 107, and a lens circuit 125 in the zoom lens LZ isconnected to an AF controller 128 of the main body BD via a connector Aand a signal bus SSL2. A flash driver 126 and an auxiliary light driver127 of the electric flash device FS are connected to the controller 128via a connector B and a signal bus SSL1.

The light beam reflected from the object passes through a lens group FLfor focus adjustment, a lens group ZL for zooming, and a master lensgroup ML of the zoom lens LZ. Then, one portion of the light beam isreflected on a main mirror 110 and goes to a finder portion, on theother hand, one portion of the light beam passes through a half mirrorportion positioned in the center portion of the main mirror 110, andgoes to an automatic focus sensor module 121 (referred to hereinafter asAF sensor module) via a submirror portion 111.

The AF sensor module 121 is connected to the AF controller 128 via aninterface circuit 122, and the lens circuit 125 is connected to the AFcontroller 128 via the connector A and the signal bus SSL2, as describedabove. The AF controller 128 calculates the aforementioned defocus valueDF from the information inputted from the AF sensor module 121. The AFcontroller 128 also converts, by receiving the lens information fed fromthe lens circuit 125 and the focal length value set by the manualrotation of a zoom ring ZR driven by a user of the camera, thecalculated defocus value DF to the number of rotations of a motor 109required for driving the lens group FL for focus adjustment for movingthe lens group FL to the in-focus position.

Moreover, the transmission mechanism for focus adjustment will bedescribed below in details. The AF controller 128 is connected to amotor driver 124 for driving the motor 109 and an encoder 123 fordetecting the speed and the number of rotations of the motor 109, andthe motor 109 is driven by the motor driver 124 so that the motor 109rotates by the number of rotations calculated by the AF controller 128.The rotation force of the motor 109 is transmitted to a big gearwheel103 arranged at the outer portion of a focus adjustment member 102 ofthe lens group FL for focus adjustment via a driving mechanism 108 ofthe main body BD of the camera, the clutch members 106 and 107, atransmission mechanism 105, and a little gearwheel 104 in the zoom lensLZ. A female helicoid screw is formed at the inner portion of the focusadjustment member 102, on the other hand, a male helicoid screw forengaging with the female helicoid screw is formed at the fixed portion101 which is formed as one body with the lens mount of the zoom lens LZ.The lens FL for focus adjustment is moved forward and backward by themechanical power transmitted to the big gearwheel 103, resulting in thatthe focus adjustment is performed.

As described above, the flash driver 126 and the auxiliary light driver127 are connected to the AF controller 128 via the connector B and thesignal bus SSL1. Turning on and off of lighting of a flash tube 130 andthe auxiliary light device AL is controlled by the AF controller 128.

An auxiliary light emitting device AL comprises a light source usinglight emitting diode LED and a contrast pattern CPAT is radiated througha radiation lens ALLENS. The wave length of the LED is 700 nmconsidering the spectral light permeability of the zoom lens LZ,spectral response of the AF sensor module 121 and uncomfortableness of aperson as an object to be photographed when the auxiliary light isradiated thereto.

FIGS. 2A and 2B are schematic diagrams of a control circuit of theautomatic focus camera shown in FIG. 1. In FIGS. 2A and 2B, 8 bitmicrocomputer MCOM is provided for controlling the whole of the camera,such as the aforementioned automatic focus adjustment and the exposurecontrol etc., and the microcomputer MCOM corresponds to the AFcontroller 128 shown in FIG. 1.

S1 denotes a switch which is turned on when a shutter release button ispushed down at the first step corresponding to a so-called half pushdown condition, and S2 denotes a switch which is turned on when theshutter release button is pushed down at the second step correspondingto a so-called push down end condition, or when the shutter releasebutton is pushed down more deeply than the first step. When the switchS1 is turned on, the power is supplied from a power supply V (not shown)to the control circuit shown in FIGS. 2A and 2B, and a sequenceoperation described below such as the focus adjustment, and the lightmeasurement etc. starts. When the switch S2 is turned on, the exposureoperation starts. Each of one terminal of the switches S1 and S2 isconnected to earth respectively. Another terminal of the switches S1 andS2 is pulled up by a voltage supply V via resistors R1 and R2respectively, and is connected to interrupt input terminals INT1 andINT2 of the microcomputer MCOM via inverters INV1 and INV2,respectively.

CCD image sensor FLM corresponds to the AF sensor module 121 shown inFIG. 1, and encloses a reference signal generator RS and a monitorcircuit MC. The monitor circuit MC generates a brightness signal AGCOSdesignating a rate of the integration of the CCD image sensor FLM, andthe reference signal generator RS generates a reference signal DOSdesignating the reference level of a brightness signal AGCOS and imagesignals OS outputted from the CCD image sensor FLM.

IF1 to IF6 and OR1 denote circuits enclosed in the aforementionedinterface circuit 122 shown in FIG. 1, and the operation of the circuitsIF1 to IF6 and OR1 will be described below in details referring to theoperation of the CCD image sensor FLM.

First of all, the CCD image sensor FLM is initialized and startsintegrating the inputted image when a high level pulse of an integrationclear signal ICG is inputted from the terminal P03 of the microcomputerMCOM to the CCD image sensor FLM. At the same time, the reference signalgenerator RS and the monitor circuit MC are initialized. As soon as theCCD image sensor FLM starts integrating the image, the reference signalgenerator RS generates the reference signal DOS, and the brightnessmonitor circuit MC generates the brightness signal AGCOS.

The AGC controller IF2 detects the brightness of the object by detectingthe difference between the brightness signal AGCOS and the referencesignal DOS, and judges the timing to stop integrating the image in theCCD image sensor FLM. If the difference between the signals AGCOS andDOS is larger than a predetermined threshold level, the AGC controllerIF2 outputs an integration stop signal TINT for stopping the integrationto the terminal P01 of the microcomputer MCOM, and also outputs thesignal TINT to the SH pulse generator IF3 and the sensor driving pulsegenerator IF4 via an OR gate OR1.

When the integration stop signal TINT is inputted to the SH pulsegenerator IF3, the SH pulse generator generates an integration stopsignal SH for stopping the integration to the CCD image sensor FLM. Onthe other hand, in response to the integration stop signal TINT, thesensor driving pulse generator IF4 converts a clock pulse φout outputtedfrom the microcomputer MCOM to sensor drive pulses φ1 and φ2 having adifferent phase from each other, and outputs the clock pulses φ1 and φ2to the CCD image sensor FLM.

On the other hand, after the microcomputer MCOM outputs the integrationclear signal ICG, the microcomputer MCOM starts counting for apredetermined time, monitoring the terminal P01. When the object is inthe low brightness condition, or the integration stop signal TINT is notinputted to the terminal P01 even though the microcomputer MCOMcompletes counting for a predetermined time, the microcomputer MCOMoutputs a high level pulse of an integration stop signal MSH from theterminal P02 to the SH pulse generator IF3 and the sensor driving pulsegenerator IF4 via the OR gate OR1, so that the CCD image sensor FLMstops the integration.

As described above, when the object is in a high brightness, the AGCcontroller IF2 makes the CCD image sensor FLM stop the integration, onthe other hand, when the object is in a low brightness, themicrocomputer MCOM makes the CCD image sensor FLM stop the integration.After stopping the integration, in accordance with the aforementionedsensor drive pulses φ1 and φ2, the CCD image sensor FLM outputs thestored signals in each of the pixel as image information signals OS.

The subtraction circuit IF1 calculates the difference between the imageinformation signal OS and the reference signal DOS, and outputs thesubtractive signal to the amplifier IF5. The amplifier IF5 amplifies thesubtractive signal outputted from the subtraction circuit IF1 so thatthe amplified signal becomes a suitable signal level for theanalog-digital converter IF6 (referred to hereinafter as A/D converter),wherein the amplification factor of the amplifier IF5 is determined by asignal outputted from the AGC controller IF2 via an output bus, inreference with the subtractive signal between the reference signal DOSand the brightness signal AGCOS which are inputted to the AGC controllerIF2 when the integration is stopped, and the amplification factor isselected from one of ×1, ×2, ×4, and ×8 and is arranged.

When the integration is stopped by the integration stop signal TINToutputted from the AGC controller IF2, the amplification factor isarranged as ×1, on the other hand, when the integration is stopped bythe integration stop signal MSH outputted from the microcomputer MCOM,the amplification factor is selected from one of ×1, ×2, ×4, and ×8 inaccordance with the brightness of the object. The amplification factoris referred to hereinafter as AGC data. The AGC data is outputted fromthe AGC controller IF2 to the amplifier IF5 and the terminals BS2 of themicrocomputer MCOM via the output bus.

Each of the image information outputted from the CCD image sensor FLM isanalog-digital converted by the A/D converter IF6 and is outputted tothe terminals BS1 of the microcomputer MCOM.

The construction and the operation of the interface circuit 12 shown inFIG. 1 is described above, and the detailed explanation is described inthe Japanese patent laid open No. 125817/1985 applied by the presentapplicant. The more detailed explanation is not described, because theconstruction and the operation of the interface circuit 12 is not thesubject matter of the present invention.

Next, the construction and the operation of the control circuit fordriving the photograph lens will be described below in details.

A motor MO1 is provided for moving the lens group FL for focusadjustment. A motor driver MDR1 is provided for driving the motor MO1,and the motor driver MDR1 makes the lens group FL for focus adjustmentmove forward and backward, and stop, in accordance with signals AFMTB,AFMTR and AFMTF respectively outputted from the terminals P10, P11, P12of the microcomputer MCOM. An encoder pulse generator ENC is enabled bythe signal AFPEN from the terminal P14 of the microcomputer MCOM, andthe encoder pulse generator ENC generates a pulse signal AFPcorresponding to the rotation quantity of the motor MO1 to the interruptterminal INT3 of the microcomputer MCOM. In the preferred embodiment,the encoder pulse generator ENC generates 16 pulses per one rotation ofthe motor MO1. In accordance with the pulse signal AFP, themicrocomputer MCOM detects the rotation quantity of the motor MO1 andoutputs the signals AFMTB, AFMTR, and AFMTF respectively from theterminals P10, P11 and P12 in order to control the motor MO1, asdescribed above. Table 1 shows the control condition of the motor MO1for the signals AFMTB, AFMTR and AFMTF.

The lens circuit LEC corresponds to the lens circuit 125 of the zoomlens LZ shown in FIG. 1, and in accordance with a start signal CSoutputted from the terminal P20 of the microcomputer MCOM, and the lenscircuit LEC transmits the lens data of the zoom lens LZ in serial to theterminal P22 of the microcomputer MCOM with a synchronizing signal SCKoutputted from the terminal P21 of the microcomputer MCOM. The lens dataoutputted from the lens circuit LEC includes the conversion factor K forconverting the defocus value DF of the zoom lens LZ to the rotationnumber of the motor MO1, an infrared rays correction quantity ΔIR₈₀₀ forcorrecting the focal position of the zoom lens LZ due to the coloraberration of the zoom lens LZ and an open aperture value Av of the zoomlens LZ for calculating the exposure control value of the camera.

The conversion factor K is defined by the following equation.

    K=N/DF

where N is a count number of the pulse signal AFP outputted from theencoder pulse generator ENC, and

DF is the defocus value DF of the zoom lens LZ calculated by the themicrocomputer MCOM from the image information output from the CCD imagesensor FLM.

The conversion factor k and value ΔIR₈₀₀ are changed corresponding tothe change of the focal length by the zooming of the zoom lens LZ.Therefore, the conversion factor K and value ΔIR₈₀₀ at the set focallength are selected out by a zoom position detection encoder (not shown)and fed to the microcomputer MCOM.

In accordance with the high level start signal CS outputted from theterminal P20 of the microcomputer MCOM, the lens circuit LEC is enabled,and the lens circuit LEC outputs the lens data SIN in serialsynchronizing to the the synchronizing signal SCK to the terminal P22 ofthe microcomputer MCOM.

The microcomputer MCOM calculates the defocus value DF from the imageinformation output from the CCD image sensor FLM, and calculates therotation quantity of the motor MO1 from the calculated defocus value DFand the conversion factor K of the lens data input from the lens circuitLEC. Then, the microcomputer MCOM performs the operation of theautomatic focus adjustment in accordance with the rotation quantity ofthe motor MO1, and when the operation of the automatic focus adjustmentis completed, the microcomputer MCOM outputs the completion of theautomatic focus adjustment to the focus condition display circuit DDCthrough the terminals BS3 so that the result is displayed by a focuscondition display circuit DDC.

A motor driver MDR2 is provided for driving a motor MO2 for advancingand rewinding the film, the motor driver MDR2 is controlled by thesignals MM and MN input from the terminals P40 and P41 of themicrocomputer MCOM. Table 2 shows the control operation of the motor MO2for the signals MM and MN.

A light measurement circuit LMC is provided for control the exposure ofthe camera, and the light measurement circuit LMC outputs themeasurement data to an A/D converter AD2. The A/D converter AD2analog-digital converts the measurement data and outputs the A/Dconverted measurement data to the terminal BS4 of the microcomputerMCOM.

An exposure control data setting circuit EDO is provided for inputting afilm sensitivity and an exposure control mode set by the photographer tothe terminal BS7 of the microcomputer MCOM.

In accordance with the aforementioned data input from the lightmeasurement circuit LMC, the lens circuit LEC and the exposure controldata setting circuit EDO, the microcomputer MCOM calculates the exposurecontrol value and outputs the exposure control value to the exposurecontrol circuit EXC from the terminal BS5, and also outputs the exposurecontrol value to the exposure display circuit EXD from the terminal BS₆,so that a desired exposure control operation is performed and theexposure control value is displayed by the exposure display circuit EXD.

A film advance mode selecting switch S3 is provided for selecting oneshot photograph or continuous photograph. A priority mode selectingswitch S4 is provided for giving the priority to the automatic focusoperation or the release operation when the release switch S2 is closed.An AF mode selecting switch S5 is provided for selecting a one shot AFmode which inhibits the AF operation after an in-focus condition isattained, or a continuous AF mode which continuously performs the AFoperation.

The respective one terminals of the switches S3, S4 and S5 is connectedto earth, respectively. Another terminal of the switches S3, S4 and S5is pulled up by a voltage supply V via pull up resistors R3, R4 and R5respectively, and is respectively connected to the terminals P60, P61and P62 of the microcomputer MCOM. Table 3 shows the control conditionfor the switching condition of the switches S3, S4 and S5.

The flash driver FLS and the auxiliary light driver ALC correspond tothe flash circuit 126 and the auxiliary light driver 127 of the electricflash device FS shown in FIG. 1, respectively. The flash driver FLS isconnected to the terminals P50 and P53 of the microcomputer MCOM via theconnector B, and the auxiliary light driver ALC is connected to theterminal P52 via the connector B. The flash driver FLS outputs a chargecompletion signal ST2 representing that a main capacitor of the flashdevice is charged up to a given level to the terminal P50 of themicrocomputer MCOM, and outputs an auxiliary light mount signal ST5representing that the mounted flash device has a function to emit anauxiliary light to the terminal P53 of the microcomputer MCOM. On theother hand, the microcomputer MCOM outputs a stop signal ST3 forterminating the flash light emission to the flash driver FLS via a flashlight control circuit FLB for controlling the timing to interrupt orterminate the flash light emission of the electric flash device FS. Themicrocomputer MCOM outputs an auxiliary light control signal ST4 fromthe terminal P52 to the auxiliary light driver ALC, wherein theauxiliary light control signal is used for controlling turning on andoff of an infrared rays light emitting diode LED used as an auxiliarylight emitter detecting the focal point. SX denotes a synchro switch SXof the camera. One terminal of the switch SX connected to earth andanother terminal thereof is connected to the flash driver FLS via theconnector B, wherein the switching condition of the switch SX istransferred to the flash driver FLS.

Next, the control operation of the preferred embodiment of theaforementioned automatic focus camera will be described below referringto the flow chart of FIGS. 3A to 3F.

When the shutter release button is pushed down at the first step, theswitch S1 is turned on, resulting in that the high level interruptsignal is inputted into the interrupt terminal INT1 of the microcomputerMCOM. In accordance with the interrupt signal into the interruptterminal INT1, the microcomputer MCOM executes the program for theautomatic focus adjustment and the automatic exposure control etc.corresponding to the flow chart shown in FIGS. 3A to 3F starting fromthe step 101.

The program flow goes from the step 101 to the step 102, the CCD imagesensor FLM is initialized. The initialization of the CCD image sensorFLM is described in the Japanese patent laid open No. 241007/1985, andit is not described in this specification because it is not theessential to the present invention. Next, at the step 105, various flagsare initialized. Table 4 shows the initialized flags with theirfunction. Moreover, the program flow goes to an integration routineCDINTA starting from the step 106.

The steps 108 and 109 are a judgment routine whether the auxiliary lightis to be emitted or not. At the step 108, if an auxiliary light modeflag ALMF is "1", the program flow goes to the step 109 to judge whetheror not a low contrast search inhibit flag LSIF is "1".

The meaning of the low contrast search will be described below. Eventhough the low contrast condition is detected at the focus conditiondetection, which only shows that the object is in a low contrastcondition only in the defocus cover range shown in the equation (3).Therefore, the object may be in the non-low contrast condition at thelens position without the defocus cover range. It is necessary torepeatedly measure the distance moving the photograph lens from thenearest position to the infinity position and judge whether or not theobject is in the low contrast condition within the whole range of thephotographed distance. Therefore, it is called "low contrast search" torepeatedly measure the distance driving the lens until it is detectedthat the object is not in the low contrast condition.

At the step 109, if the low contrast search inhibit flag LSIF is "0" orthe low contrast search is permitted, the program flow goes to the step110. At the step 110, 80 msec is set as a maximum integration time Tmaxof the CCD image sensor FLM, and at the step 111, the auxiliary lightcontrol signal ST4 is made high level. Then, the auxiliary light driverALC is enabled and the light emitting diode LED starts lighting. Next,at the step 112, the microcomputer MCOM waits for 5 msec in order torecover the time response of the CCD image sensor FLM for a brightnesschange of the object after the light emitting diode LED starts lighting,and then, at the step 114, the CCD image sensor FLM starts theintegration operation.

On the other hand, if the auxiliary light mode flag ALMF is "0" at thestep 108, or if the low contrast search inhibit flag LSIF is "1", theauxiliary light is not turned on, and 20 msec is set as the maximumintegration time Tmax at the step 113, the program flow goes to the step114, and the CCD image sensor FLM starts the integration operation.

After the CCD image sensor FLM starts the integration operation, it isjudged whether or not the high level integration stop signal TINT to beinput from the AGC controller IF2 is detected at the step 115. If thehigh level integration stop signal TINT is detected due to thecompletion of the integration within the maximum integration time Tmax,the program flow goes to the step 118, on the other hand, if the highlevel integration stop signal TINT is not detected, the program flowgoes to the step 116. At the step 116, it is judged whether or not thecount time T is larger than the maximum integration time Tmax arrangedat the steps 110 or 113. If the count time T is larger than Tmax, theprogram flow goes to the step 117, on the other hand, if the count timeT is not larger than Tmax, the program flow goes back to the step 115.At the step 117, the microcomputer MCOM outputs the integration stopsignal MSH to the CCD image sensor FLM via the OR gate OR1 and the SHpulse generator IF3, then the microcomputer calculates the integrationtime based on the count time at the steps 1171 and 1172. At the step 118shown in FIG. 3C, the microcomputer MCOM outputs the low level auxiliarylight control signal ST4 to the auxiliary light driver ALC, so thatlighting of the light emitting diode LED is stopped.

Next, at the step 119, the microcomputer MCOM latches the AGC datainputted from the AGC controller IF2, and then, at the step 120, themicrocomputer MCOM makes the CCD image sensor FLM start the integrationoperation of the next cycle, and the microcomputer MCOM starts detectingthe light measurement data from the light measurement circuit LMC viathe A/D converter AD2 at the step 121. Moreover, at the step 122, themicrocomputer MCOM latches the aforementioned 8 bit pixel data detectedin the CCD image sensor FLM at the steps 114 to 117. The latch operationof the microcomputer MCOM is referred to hereinafter as data dump. Inparallel with the data dump operation, the microcomputer MCOM calculatesthe pixel peak value P of the equation (4) and the contrast value C ofthe equation (5).

Next, at the step 123, the microcomputer MCOM communicates with the lenscircuit LEC of the zoom lens LZ so that the microcomputer MCOM latchesthe conversion factor K, the open aperture value Avo, and the infraredrays correction value ΔIR₈₀₀ and the auxiliary light mount signal.Moreover, at the step 124, the microcomputer MCOM calculates the defocusvalue DF of the equation (2) from the latched pixel data.

At the steps 125 to 127, the microcomputer MCOM performs the exposurecalculation. First of all, at the step 125, the microcomputer MCOMlatches the light measurement data whose detection has been started atthe step 121, and then, at the step 126, after the microcomputer MCOMlatches the aforementioned set exposure control data and the data of theAF mode described in Table 3, the flags designating each of the modesare arranged. Next, at the step 127, the microcomputer MCOM calculatesthe exposure control value, and then, at the step 128, the calculateddata for the exposure control is displayed by the exposure displaycircuit EXD. Moreover, at steps 129 and 130, it is judged whether or notlighting of the auxiliary light is performed during the integration ofthe CCD image sensor FLM, by judging the auxiliary light mode flag ALMFand the low contrast search inhibit flag LSIF. If the auxiliary lightmode flag ALMF is "1" and the low contrast search inhibit flag LSIF is"0", or if lighting of the auxiliary light is performed during theintegration of the CCD image sensor FLM, the program flow goes to thestep 131.

At the step 131, the correction of the infrared rays correction quantityΔIR is performed.

The correction of the ΔIR is made under the control of the sub routineshown in FIG. 4.

As shown in the equation (13), the correction is made using either thecontrast of the object when the auxiliary light is emitted and thecontrast of the object under the ambient light.

Since the ΔIR correction is made only when the auxiliary light isemitted at the steps 129 and 130 as shown in FIG. 3C, the contrast inthe step 402 represents the contrast of the object at the time of theauxiliary light emission.

The contrast is divided by AGC data so as to obtain the contrast whenthe AGC data is 1. The contrast is divided by the integration timeTINTEG of the image sensor, then multiplied with 20, whereby the mixedcontrast Cmix for the case of integration time 20 msec. AGC X1 isobtained in the step 403.

Similarly, the contrast of the object under the ambient light for theintegration time 20 msec. AGC X 1 is obtained. The contrast under theambient light is stored in the RAM of the microcomputer MCOM under thename CONTST and is updated every time of the integration of the imagesensor when the auxiliary light is not emitted. The contrast data CONTSTis divided by the AGC data AGCST, the contrast for AGC X 1 under theambient light is obtained in the step 404. The contrast thus divided bythe AGC data is divided by the integration time TST for the ambientlight and multiplied with 20, the contrast at the time of theintegration time 20 msec. AGC X 1 under the ambient light can beobtained in the step 405. Subsequently, the color aberration ΔIR₇₀₀ forthe light of 700 nm is calculated in the step 406 by the equation (9).

    ΔIR.sub.700 =ΔIR.sub.800 × (700-587)/(800-587)

Moreover, in the step 407, the color aberration ΔIR₈₀₀ on the axis ofthe mixed light under the auxiliary light emission is obtained bymultiplying the ΔIR₇₀₀ obtained in the step 406 with (1-Cdl/Cmix).Subsequently, the detected defocus value DF is subtracted by ΔIR₇₀₀ mixso as to obtain the true defocus value in the step 408. Then the programgoes to the next steps 132 to 134 shown in FIG. 3D wherein thereliability of the measured distance is checked. That is, it is judgedwhether or not the pixel peak value P shown by the equation (4) islarger than a predetermined threshold value P1 at the step 132, it isjudged whether or not the contrast value C shown in the equation (5) islarger than a predetermined threshold value C1 at the step 133, and itis judged whether or not the correlation level value YM of the equation(6) is smaller than a predetermined threshold value YM1.

Larger the pixel peak value P and the contrast value C become, orsmaller the correlation level value YM becomes, the reliability of themeasured distance becomes higher. Therefore, if P>P1, C>C1, and YM<YM1,it is judged that the measured distance has a high reliability, then,the program flow goes to the step 135. At the step 135, the low contrastsearch inhibit flag LSIF, low contrast searching flag LSDF and a flagLSF designating a detecting times of the extreme position of thephotograph lens are reset into "0". On the other hand, when P≦P1, C≦C1,or YM≧YM1, it is judged that the reliability of the measured distance islow, and then, the program flow goes to the step 136. After the in-focusflag IFF is reset into "0" at the step 136, the program flow goes to thestep 137 of the low contrast process routine in the case when thedistance can not be measured.

On the other hand, in case the auxiliary light is not emitted, theprogram flow goes to the step 1311 in which the integration time (ITIME)calculated at the step 1172 is stored in the RAM. The integration timeITIME is used as the integration time data TST in the process of ΔIRcorrection routine. In the steps 1312 and 1313, the contrast data andAGC data are stored in the RAM and used in the ΔIR correction routine.These data are respectively updated every time the integration of theCCD image sensor is performed. Then the program flow goes to thereliability test routine shown in FIG. 3E. It is judged whether or notthe pixel peak value P is larger than a predetermined threshold valueP2. Moreover, at the step 139, it is judged whether or not the contrastvalue C is larger than a predetermined threshold value C2, and at thestep 140, it is judged whether or not the correlation level value YM issmaller than a predetermined threshold value YM2. If P>P2, C>C2, andYM<YM2, it is judged that the reliability of the measured distance ishigh, and then, the program flow goes to the step 135 shown in FIG. 3D.On the other hand, if P≦P2, C≦C2, or YM≦YM2, it is judged that thereliability of the measured distance is low, and then, the program flowgoes to the step 141. At the step 141, it is judged whether or not theauxiliary light mount signal ST5 is high, that is, whether or not theauxiliary light device AL is mounted. If the auxiliary light device ALis mounted, the program flow goes to the step 142, it is judged whetheror not the amplification factor output from the AGC controller IF2 is"1". If the the amplification factor is not "1", or the amplificationfactor is "2", "4", or "8", it is judged that the object is in a darkcondition, and then, at the step 143, "1" is set in the auxiliary lightmode flag ALMF, and the program flow goes to the step 144 of anintegration routine CDINTA starting from the step 106 shown in FIG. 3A.

Thereafter the auxiliary light mode is executed to emit the auxiliarylight for the focus detection. The data stored in the RAM in the steps1311, 1312 and 1313 are used in the next cycle of the ΔIR correction.

On the other hand, if the auxiliary light mount signal ST5 is low at thestep 141, or if the amplification factor is "1", the program flow goesto the aforementioned step 132, and then, the judgment of the pixel peakvalue P, the contrast value C, and the correlation level value YM areperformed.

The aforementioned threshold values P1, C1, YM1, P2, C2, and YM2 arearranged so that P1<P2, C1<C2, and YM1>YM2, resulting in that thereliability of the measured distance at the steps 138, 139 and 140 isjudged more severely than the judgment of the reliability of themeasured distance at the steps 132, 133 and 134. When the auxiliarylight is not turned on during the integration of the CCD image sensorFLM, larger reference threshold levels (at the steps 138 to 140) arearranged than the reference threshold levels at the steps 132 to 134. Ifthe judged values are not satisfied with the larger reference thresholdlevels, the program flow goes to the auxiliary light mode routinestarting from the step 141. At the auxiliary light mode, if theauxiliary light device is not mounted or the reliability of the measureddistance is low even though the object is in an enough bright condition,the program flow goes to the steps 132 to 134 because the auxiliarylight can not be turned on, and the reliability of the measured distancehaving one step lower reference threshold levels is judged again.Therefore, when the auxiliary light device AL is mounted, the referencethreshold levels for the judgment of the reliability of the measureddistance with ambient light is raised, resulting in that the auxiliarylight can be turned on properly without measuring the distance at a lowreliability. On the other hand, when the auxiliary light is turned onduring the integration of the CCD image sensor FLM, or when theauxiliary light can not be turned on, the reference threshold levels ofthe reliability is reduced, resulting in that the reliability of theoperation of the distance measurement can be raised for various kinds ofobjects.

When it is judged that the reliability of the measured distance is highat the aforementioned routine, the program flow goes from the step 135to the step 145 shown in FIG. 3D. At the step 145, the microcomputerMCOM calculates the encoder pulse count number N from the conversionfactor K and the defocus value DF calculated at the step 124, and then,the program flow goes to the step 146. The encoder pulse count number Nmust be corrected, because the defocus value DF at the step 124 iscalculated in accordance with the data representing the pictureinformation during the integration period at steps 114 to 117.Therefore, the rotation number NM of the motor MO1 from the centertiming of the integration period to the step 145, when the encoder pulsecount number N is calculated, is subtracted from the calculated encoderpulse count number N, the subtracted value is newly set as the encoderpulse count number N at the step 146, wherein "0" is set as the rotationnumber of the motor MO1 when the motor MO1 stops.

As described above, the encoder pulse count number N for driving themotor MO1 to the in-focus position of the photograph lens can beobtained, and then, the program flow goes to a motor control routineMPULS starting from the step 147.

At the step 148, it is judged whether or not a high speed flag HSF is"1", if HSF is "1", or the motor MO1 rotates at a high speed of 10,000rpm, the program flow goes to a motor control routine MSSET startingfrom the step 149 shown in FIG. 3F, and then, "0" is set in the in-focusflag IFF. At the next step 151, the calculated encoder pulse countnumber N at the step 146 is compared with a predetermined near zonepulse count number Nzon, wherein the near zone count number Nzon isprovided for judging the switching of the rotation speed of the motorMO1. If the photograph lens is near to the in-focus position, or theencoder pulse count number N is smaller than the near zone pulse countnumber Nzon, the rotation speed of the motor MO1 is set at a low speedof 1,000 rpm at the step 152. By the above control, the motor MO1 iscorrectly controlled without the photograph lens's overrunning thein-focus position. After the step 152, the program flow goes to the step153, the high speed flag HSF is set "0", and then, the control of themotor MO1 starts at the step 154, and the the program flow goes to theintegration routine CDINT starting from the step 200 shown in FIG. 3B.

On the other hand, at the step 151, if the encoder pulse count number Nis equal to or larger than the near zone pulse count number Nzon, theprogram flow goes to the step 156, the rotation speed of the motor MO1is set at a high speed of 10,000 rpm. Then, after "1" is set in the highspeed flag HSF at the step 157, the program flow goes to the step 154.

On the other hand, if the high speed flag HSF is "0" at the step 148shown in FIG. 3D, or the motor MO1 rotates at a low speed of 1,000 rpmor the motor MO1 stops, the program flow goes to the step 158, theencoder pulse count number N calculated at the step 146 is compared withan in-focus pulse count number Ninf designating a range of apredetermined in-focus condition. If the encoder pulse count number N isequal to or smaller than the in-focus pulse count number Ninf, it can bejudged that the photograph lens is positioned at the in-focus position,and then, the in-focus condition is displayed at the step 159. Moreover,it is judged whether or not a one shot AF flag OAFF is "1" at the step160, wherein "1" is set in the one shot AF flag OAFF when the photographlens is positioned in an in-focus position and the driving of thephotograph lens is locked. If the one shot AF flag OAFF is "1" at thestep 160, the program flow goes to the step 161, the microcomputer MCOMwaits for the interrupt signal inputted into the interrupt terminal INT2or INT3. As described above, when the motor MO1 rotates at a low speedand the encoder pulse count number N calculated from the measureddistance is equal or smaller than the in-focus pulse count number Ninf,the motor MO1 is driven until the encoder pulse count number N outputtedfrom the encoder pulse generator ENC becomes Ninf without the distancemeasurement again, and the photograph lens is positioned and locked atan in-focus position.

At the step 160, if the one shot AF flag OAFF is "0", or the continuousAF mode during the automatic focus operation is arranged, the programflow goes to the routine CDINT starting from the step 200 shown in FIG.3B. On the other hand, if the encoder pulse count number N is largerthan the in-focus pulse count number Ninf at the step 158, the programflow goes to the step 163, the display of the in-focus condition isturned off, and then, the program flow goes to the motor speed controlroutine MSSET starting from the step 149 shown in FIG. 3F.

As described above, the integration of the the CCD image sensor FLM andlighting of the auxiliary light are performed not only when the motorMO1 stops but also when the motor MO1 rotates, resulting in that theautomatic focus operation is performed at a higher speed than the cameraof the prior art.

Furthermore, the distance measurement routine CDINT starting from thestep 200 shown in FIG. 3B will be described below in details. In thedistance measurement routine CDINT, "a preliminary integration" andmonitoring of the peripheral light during the auxiliary light modedescribed below in details are performed.

First of all, "the preliminary integration" and monitoring of theoutside light during the auxiliary light mode are described below indetails referring to FIG. 8. FIG. 8 shows a timing chart of theintegration, lighting of the auxiliary light, the data dump from the CCDimage sensor FLM, as well as the contrast value calculation, thedistance calculation, the AF control, the automatic exposure (referredto hereinafter as AE) calculation and the latch of the AGC data from theAGC controller IF2, performed in parallel therewith, wherein each of theoperations is performed when each of the signals is high levelrespectively.

In FIG. 8, TA denotes a period of the auxiliary light mode, and thesteps 108 to 118 are performed during the auxiliary light mode asdescribed above. That is, first of all, the auxiliary light emissionstarts at a time t1, and an integration TI1 of the CCD image sensor FLMstarts at a time t2 after the passage of 5 msec from the time t1. Theintegration TI1 stops at a time t3 from the passage of theaforementioned integration time from the time t2, the integration timebeing shorter than 50 msec. Then, the auxiliary light is turned off andthe microcomputer MCOM latches the AGC data (AGC1) from the AGCcontroller IF2. Immediately after the latch of the AGC data (AGC1), anintegration TI2 of the CCD image sensor FLM starts and the lightmeasurement starts at a time t4. In parallel with the light measurementoperation, the data dump DUM1 of the CCD image sensor FLM obtained atthe integration TI1 is performed and the contrast value C is calculated.At a time t5 corresponding to the end timing of the data dump and thecalculation of the contrast value C, the process DFC1 including thedistance calculation, the AF control and the AE calculation starts.

As described above, an error of the light measurement due to thelighting of the auxiliary light is not caused, because the lightmeasurement starts at the time t4 after the time t3 when the auxiliarylight is turned off. Then, the aforementioned integration TI2 stops, ata time t6 corresponding to the end of the distance measurement, the AFcontrol, and the AE calculation of the process DFC1. That is, after thestop of the integration TI1, the next integration TI2 starts, performingin parallel with the data dump of the CCD image sensor FLM of the pixeldata obtained at the previous integration TI1 and the calculation of thecontrast value C (DUM1), the distance measurement, the AF control, andthe AE calculation (DFC1), and then, the integration TI2 stops at thetime t6 corresponding to the end of the processes DUM1 and DFC1.

As described above, a control process is referred to as the preliminaryintegration which is the process that the next integration starts andprocessing of the integrated pixel data obtained at the previousintegration is performed in parallel with the next integration after theintegration of the CCD image sensor FLM. The efficiency of theintegration of the CCD image sensor FLM can be raised and also theautomatic focus operation is performed at a higher speed than the cameraof the prior art, because the cycle time of the distance measurement isshortened.

In the preferred embodiment, it takes a constant time of approximately20 msec from the end of the first integration to the end of the AFcontrol operation, resulting in that it takes approximately 20 msec toperform the preliminary integration TI2. It is apparent from the flowchart of FIG. 3 that the auxiliary light is turned off during thepreliminary integration. That is, at the preliminary integration TI2,the integration is performed on the condition that the auxiliary lightis not turned off, and the real brightness and the real contrast value Cof the object itself can be obtained on the condition that the auxiliarylight is not turned off by detecting the AGC data (AGC2) and thecontrast value C during the preliminary integration.

Furthermore, the distance calculation is not performed, and the latch ofthe AGC data and the data dump of the CCD image sensor FLM are performedat the preliminary integration during the auxiliary light mode.Therefore, the data dump of both of the reference portion and themeasurement portion of the CCD image sensor FLM is not required. In thepreferred embodiment, the data dump of only the reference portion of theCCD image sensor FLM is performed, resulting in that it takesapproximately half time of the normal data dump DUM1 of the CCD imagesensor FLM to perform the data dump DUM2 at the preliminary integrationduring the auxiliary light mode. Furthermore, the brightness and thecontrast value C of the object can be quickly obtained because thecontrast value C is calculated in parallel with the data dump DUM2, andalso the judgment can be quickly performed whether the next integrationmust be performed with ambient light or the auxiliary light.

In the preferred embodiment, if the object is in a bright condition, orif the AGC data is "1" and if the contrast value C is larger than apredetermined value C3, the auxiliary light mode is canceled. On theother hand, if the AGC data is "2", "4", or "8", or if the contrastvalue C is equal to or smaller than the predetermined threshold valueC3, the auxiliary light mode is maintained and the auxiliary light isturned on at the next cycle. The predetermined threshold value C3 andits meanings will be described below in details. In the integration TI3of FIG. 8, the auxiliary light mode is maintained by the AGC data (AGC2)and the contrast value C (DUM2), at the preliminary integration TI2, andthe integration TI3 is performed with lighting of the auxiliary light.

Furthermore, the operation after the auxiliary light mode is canceledwill be described above in details.

If the AGC data AGC3 at the preliminary integration TI4 is "1" or if thecontrast value C calculated at DUM3 is larger than the predeterminedthreshold value C3, the auxiliary light mode is canceled, and theauxiliary light is not turned on during the next integration TI5. InFIG. 8, TB denotes a period when the auxiliary light mode is notarranged, in this case, the data dump (DUM4) of all the data of the theCCD image sensor FLM during the preliminary integration TI6 isperformed, and the distance calculation, the AF control, and the AEcalculation (DFC2) are performed.

In FIG. 8, TC denotes a period when the brightness of the object islarger than the brightness of the object during the periods TA and TB.The integration of the CCD image sensor FLM is stopped by the AGCcontroller IF2 before the integration time reaches the maximumintegration time. That is, the processing time of the integration isshorter than 20 msec, and a preliminary integration TI7 stops before theprocess DFC2 corresponding the calculation of the data obtained at theintegration TI6. The data of the preliminary integration TI7 isneglected, and the next integration TI8 starts after the process DFC2.

Referring to FIG. 3B again, the distance measurement routine CDINT willbe described below in details, wherein the aforementioned preliminaryintegration and the judgment during the auxiliary light mode areperformed.

First of all, at the step 201, it is judged whether or not the auxiliarylight mode flag ALMF is "1", if the auxiliary light mode flag ALMF is"1", or the auxiliary light mode is arranged, the program flow goes tothe step 202, it is judged whether or not the integration stop signalTINT is high. If the integration stop signal TINT is high, the programflow directly goes to the step 208, "0" is set in the auxiliary lightmode flag ALMF, and then, the program flow goes to the integrationroutine CDINTA starting from the step 106. That is, when it is judgedthat the integration stops within 20 msec for the previous integrationprocess and the object is in an enough bright condition, the auxiliarylight mode flag ALMF is reset and the auxiliary light mode is canceled.

On the other hand, if the integration stop signal TINT is low at thestep 202, the integration of the CCD image sensor FLM is stopped at thestep 203, and then, the AGC data is latched at the step 204. Moreover,at the step 205, it is judged whether or not the AGC data is "1". If theobject is in a bright condition, or the AGC data is "1", the programflow goes to the step 208, on the other hand, if the AGC data is not"1", the program flow goes to the step 206, the contrast value C iscalculated in parallel with the data dump of the reference portion ofthe CCD image sensor FLM.

Subsequently, the contrast data is taken in the RAM of the microcomputerMCOM in the step 2061. The contrast data is used as the data COKTST forcorrecting ΔIR in case the auxiliary light is emitted and theintegration is performed. Then the AGC data is stored at the step 2062.The integration time 20 msec in this embodiment is stored in the RAM andis used for the ΔIR correction.

Then, it is judged whether or not the contrast value C is larger thanthe predetermined threshold C3 at the step 207. If the contrast value Cis larger than C3, it is judged that the object itself has an enoughcontrast, the auxiliary light mode flag ALMF is reset at the step 208.On the other hand, if the contrast value C is equal to or smaller thanC3, it is judged that the auxiliary light mode is to be maintained, theprogram flow goes to the integration routine CDINTA starting from thestep 106.

The aforementioned threshold value C3 is predetermined so that C3>C2,wherein C2 is the threshold value used at the aforementioned step 139.That is, the condition for entering the auxiliary light mode is arrangedmore severely than the condition for going out from the auxiliary lightmode, resulting in that the auxiliary light mode can not be cleared fora slightly change of the contrast value C once the auxiliary light modeis selected. Therefore, it can be prevented that the distancemeasurement is performed unstably because the auxiliary light mode isselected and not selected repeatedly causing a difference between themeasured distance during lighting of the auxiliary light and themeasured distance with ambient light.

Thus, at the preliminary integration during the auxiliary light mode,the auxiliary light is not turned on, the integration of the CCD imagesensor FLM is performed with ambient light, and the latch of the AGCdata, the data dump of the reference portion of the CCD image sensor FLMand the calculation of the contrast value C are performed. Thebrightness and the contrast of the object are judged from the latchedAGC data and the calculated contrast value, and it is judged whether ornot the auxiliary light mode is to be continued.

As described above, at the preliminary integration during the auxiliarylight mode, the auxiliary light mode is judged only by the AGC data andthe contrast value C without the auxiliary light and the calculation ofthe distance is not performed. Therefore, the brightness and thecontrast of the object can be judged for a short time, and it can bejudged quickly whether or not the auxiliary light is to be turned on fora change of the brightness and the contrast of the object.

Moreover, since the brightness and contrast of the object can beobtained in a period of the preliminary integration, the ΔIR correctioncan be made accurately and rapidly in case the subsequent cycle isexecuted in the auxiliary light mode.

In the embodiment mentioned above, if it is judged that the object is ina bright condition at the step 205, or if it is judged that the objecthas an enough contrast at the step 207, the distance may be calculatedby the data of the preliminary integration, because the possibility forperforming the distance measurement with ambient light is high. That is,if the AGC data is "1" at the step 205, the auxiliary light mode may becanceled, and the program flow may go to the step 120. On the otherhand, if C>C3 at the step 207, the auxiliary light mode may be canceledand the program flow may go to the step 122 to perform the data dump ofthe measurement portion of the CCD image sensor FLM because the datadump of the reference portion of the CCD image sensor FLM is completed,and then, the program flow may go to the step 123.

At the steps 132 to 134, if it is judged that the object is in a lowcontrast condition, or if it is judged that the distance can not bemeasured because the reliability of the measured distance is low, theprogram flow goes to a low contrast process routine shown in FIGS. 6A to6C.

In FIGS. 6A to 6C, first of all, at the step 602, it is judged whetherthe photograph lens is positioned at the extreme position of theinfinity photographing position or the nearest photographing position tothe object, and the judgment is referred to hereinafter as the theextreme position detection. The extreme position detection is judged bydetecting whether or not the encoder pulse outputted in accordance withthe movement of the photograph lens is outputted within a predeterminedconstant time. If the photograph lens is not positioned at the extremeposition, the program flow goes to the step 603, it is judged whether ornot the low contrast search inhibit flag LSIF is "1". If the lowcontrast search is inhibited, or the flag LSIF is "1", the program flowgoes to the aforementioned distance measurement routine CDINT startingfrom the step 620, on the other hand, if the low contrast search ispermitted, or the flag LSIF is not "1", the program flow goes to the lowcontrast process routine LCONS starting from the step 604.

In the low contrast process routine LCONS, the program flow goes fromthe step 604 to the step 605, "1" is set in a low contrast searchingflag LSDF, and then, the maximum value MAX is set in the encoder pulsecount number N, wherein the maximum value MAX is a maximum value whichcan be set in the encoder pulse counter, such as FFFF in hexadecimal.

At the next step 607, the display is turned off, and then, it is judgedwhether or not the auxiliary light mode flag ALMF is "1" at the step608. If the auxiliary light mode flag ALMF is "1", the program flow goesto the step 609. At the steps 609 to 613, switching of the rotationspeed of the motor MO1 and switching of the cycle of the distancemeasurement during the auxiliary light mode are performed by judging theconversion factor K for converting the defocus value DF to the rotationquantity of the motor MO1, and the switching control will be describedbelow in details referring to FIGS. 9A to 9C.

FIG. 9A shows a characteristic of the movement of a position of thephotograph lens to time t with respect to the defocus cover range whenthe low contrast search is performed properly. The distance measurementis performed at time tc1, tc2 and tc3. The change of the position of thephotograph lens can be determined by the aforementioned conversionfactor K on the condition cf a constant rotation speed of the motor MO1,and the position linearly varies for time t as shown in a direct line A1of FIG. A1. In FIGS. 9A to 9C, the distance can be measured in the rangeDFE1 at the time tc1, the distance can be measured in the range DFE2 atthe time tc2, and the distance can be measured in the range DFE3 at thetime tc3, wherein the ranges DFE1, DFE2, and DFE3 are the defocus coverrange of the defocus value DF determined by the equation (3). It isapparent from FIG. 9A, since the ranges DFE1 and DFE2 and the rangesDFE2 and DFE3 are respectively overlapped, the distance can be properlymeasured by one of the ranges, even though the object is at anycorresponding position.

FIG. 9B shows a characteristic of the movement of a position of thephotograph lens for time t when the conversion factor K is smaller thanK of the case of FIG. 9A. As shown in a direct line A2 of FIG. 9B, theslope factor of the direct line A2 is larger than the slop factor of thedirect line A1 of FIG. 9A, resulting in that the moving distance of thephotograph lens per a unit time is longer than the moving distance inthe case of FIG. 9A. Therefore, the ranges DFE1, DFE2, and DFE3 at thetime tc1, tc2 and tc3 do not respectively continue, and there are tworanges DZ1 and DZ2 where the distance can not be measured. In thepreferred embodiment, when the conversion factor K is small, the speedof the motor MO1 is reduced, and the ranges DZ1 and DZ2 can be preventedfrom occurring where the distance can not be measured.

FIG. 9C shows a characteristic of the movement of a position of thephotograph lens for time t when the conversion factor K is larger than Kof the case of FIG. 9A. As shown in a direct line A3 of FIG. 9C, theslope factor of the direct line A3 is smaller than the slope factor ofthe direct line A1 of FIG. 9A, resulting in that the moving distance ofthe photograph lens per a unit time is shorter than the moving distancein the case of FIG. 9A. Therefore, the ranges DFE1, DFE2 and DFE3 at thetime tc1, tc2 and tc3 are overlapped each other so that the overlappedportions are longer than the overlapped portions in FIG. 9A. That is,the range DFE2 is not required, and the distance between the camera andthe object can be measured even though the distance measurement at thetime tc2 is omitted. In the preferred embodiment, when the conversionfactor K is larger than a predetermined value, after the photograph lensis moved by a constant distance, the next distance measurement starts,resulting in that the lighting times of the auxiliary light can bereduced without the range of the measured distance where the distancecan not be measured, the power consumption of the auxiliary light can bereduced, and the dazzling times to men as the object can be reduced.

Referring back to the flow chart of FIG. 6A, the aforementioned lowcontrast search during the auxiliary light mode will be described below.

At the step 609, it is judged whether or not the conversion factor K islarger than a predetermined threshold value KAL1. If the conversionfactor K is equal to or larger than KAL1, the program flow goes to thestep 610, the rotation speed of the motor MO1 is set at a speed of10,000 rpm, and then, the conversion factor K is compared with apredetermined threshold value KAL2 at the step 611, wherein the valueKAL2 is arranged so that KA12>KAL1. If the conversion factor K issmaller than KAL2, i.e., KAL1≦K<KAL2, and this case correspond to FIG.9A. Then, the program flow goes to the step 614, the control of themotor MO1 starts, and the program flow goes to the distance measurementroutine CDINT at the step 620. On the other hand, the conversion factorK is equal to or larger than KAL2 at the step 611, and this casecorresponds to FIG. 9C. In this case, an unnecessary distancemeasurement may be performed, as described above. Therefore, after thecontrol of the motor MO1 starts at the step 612, at the step 613, thephotograph lens is moved until the encoder pulse count number N arrangedat the step 606 becomes the value (MAX-NS) from the maximum value MAX,that is, the photograph lens is moved by NS pulses, and then, theprogram flow goes to the step 614.

On the other hand, if the conversion factor K is smaller than KAL1 atthe step 609, this case corresponds to FIG. 9B, the ranges which can notbe measured may occur as described above. Therefore, the rotation speedof the motor MO1 is reduced into 5,000 rpm at the step 640, and then,the program flow goes to the step 614.

If it is judged at the step 608 that the auxiliary light mode is notarranged, the conversion factor K is compared with a predeterminedthreshold value KAL3 at the step 615 shown in FIG. 6C. If K <KAL3, themotor MO1 is set at a rotation speed of 5,000 rpm at the step 616, onthe other hand, if K≧KAL3, the motor MO1 is set at a rotation speed of10,000 rpm at the step 617, and then, the program flow goes from thesteps 616 and 617 to the step 614.

The predetermined threshold value KAL3 is arranged so that KAL3<KAL1.Because the period time of the auxiliary light mode is longer than thecycle of the distance measurement with ambient light, and the conversionfactor K is generally large during the distance measurement with ambientlight, resulting in that there is not a problem that the powerconsumption is raised during the distance measurement with the auxiliarylight, and men of the object is dazzled by the auxiliary light.Therefore, when K≧KAL3, the motor MO1 rotates at a high speed of 10,000rpm, and the distance measurement is repeatedly performed.

As described above, when the defocus value DF of the photograph lens forthe distance between the object and the camera is too large and thedefocus value DF is not within the defocus cover range, the distancemeasurement moving the photograph lens is repeatedly performed. Thedistance measurement is performed correctly and efficiently by switchingthe rotation speed of the motor MO1 depend upon the conversion factor K.That is, during the auxiliary light mode, even though the conversionfactor K is small, the range where the distance can not be measured isnot caused by driving the motor MO1 at a lower rotation speed. On theother hand, when the conversion factor K is large, the lighting times ofthe auxiliary light can be reduced to a minimum times, resulting in thatthe power consumption can be reduced and feeling for using the cameracan be improved.

Next, the case will be described below when it is detected at the step602 that the photograph lens is positioned at the extreme position.

The program flow goes from the step 602 to the step 618 shown in FIG.6B, the motor MO1 is stopped, and then, it is judged whether or not thelow contrast search inhibit flag LSIF is "1" at the step 619. If theflag LSIF is "1", or the low contrast search is inhibited, the programflow goes to the distance measurement routine CDINT of the next cycle atthe step 620, on the other hand, if the flag LSIF is "0", or the lowcontrast search is permitted, it is judged whether or not the lowcontrast searching flag LSDF is "1" at the step 621. If the flag LSDF is"0", or the low contrast search starts from the extreme position of thephotograph lens, "0" is set in a flag LSF designating the first extremeposition detection during the low contrast search at the step 629, andthen, the direction of rotation of the motor MO1 is inverted at the step630, and the program flow goes to the low contrast search processroutine LCONS at the step 631.

On the other hand, at the step 621, if the low contrast searching flagLSDF is "1" or the low contrast search process is being performed, withthe photograph lens being positioned at the extreme position during thelow contrast search, it is judged whether or not the aforementioned flagLSF is "1" at the step 622, if the flag LSF is "1" or this is the firstextreme position detection, the program flow goes to the step 629, andthen, the low contrast search is continued. On the other hand, if theflag LSF is "0", or this is the second extreme position detection, "1"is set in the low contrast inhibit flag LSIF at the step 623, and then,"0" is set in the low contrast searching flag LSDF at the step 624.Next, the display of the low contrast condition is turned on in the step625 and then, the program flow goes to the step 626, where it is judgedwhether or not the one shot AF flag OAFF is "1", wherein the one shot AFflag OAFF is provided for locking the photograph lens at the positionand inhibiting the automatic focus operation once it is judged that theimage is in an in-focus position. If the one shot AF flag OAFF is "1",or the one shot AF mode is arranged, the microcomputer MCOM waits forthe interrupt signal again inputted into the interrupt terminal INT1 orINT2 in the step 627 On the other hand, the one shot AF flag OAFF is"0", or the one shot AF mode is not arranged, the program flow goes tothe distance measurement routine CDINT at the step 628.

In the preferred embodiment, at the above steps 618 to 622, if theextreme position of the photograph lens is detected twice during the lowcontrast search, lighting of the auxiliary light is inhibited when thelow contrast search is inhibited. This process is performed for thefollowing reason. That is, even though the distance measurement isperformed with the auxiliary light after the end of the low contrastsearch, the possibility of detecting the focus condition is low, thepower consumption is increased and also a larger unpleasant feeling isgiven as men of the object. That is, if the distance can not be measuredduring the low contrast search, even though the extreme positiondetection is performed twice, the next low contrast search is inhibitedand lighting of the auxiliary light is inhibited, resulting in that nomeaning lighting of the auxiliary light can not be performed, and alsothe power consumption is reduced, feeling of using the camera can beimproved.

Next, when the rotation quantity of the motor MO1 is detected by theencoder pulse generator ENC and a predetermined pulse signal AFP isinputted into the interrupt terminal INT3 of the microcomputer MCOM, theinterrupt routine INT3 is performed shown in FIG. 7.

First of all, at the step 702, 1 is subtracted from the encoder pulsecount number N and the subtracted value (N-1) is newly set in theencoder pulse count number N, and then, it is judged whether or not thethe encoder pulse count number N is smaller than a predeterminedthreshold value Nzon at the step 703. If the encoder pulse count numberN is equal to or larger than Nzon, this is the case when the motor MO1is driven at a high speed, the control of the motor MO1 starts at thestep 713, and then, the program flow returns back to the main routine atthe step 712. On the other hand, if the encoder pulse count number N issmaller than Nzon, the program flow goes to the step 704, "0" is set inthe high speed flag HSF, and then, the motor MO1 is set at a rotationspeed of 1,000 rpm. As a result, the speed of the motor MO1 can beproperly controlled, and the photograph lens can be prevented fromoverrunning the in-focus position. Moreover, it is judged whether or notthe encoder pulse count number N is smaller than Ninf, if N≧Ninf at thestep 706, it is judged that the photograph lens is not positioned withinthe in-focus range, and then, the program flow goes to the step 713 tocontinue the driving of the motor MO1.

On the other hand, if the encoder pulse count number N is smaller thanthe predetermined threshold value Ninf, it is judged that the photographlens is positioned within the in-focus range, "1" is set in the in-focusflag IFF at the step 707, and then, the display of the in-focuscondition is turned on at the step 708. When "1" is set in the in-focusflag IFF, the release operation is permitted during the AF prioritymode, and the release operation is inhibited when the in-focus flag IFFis reset.

The program flow goes from the step 708 to the step 709, it is judgedwhether or not the encoder pulse count number N is "0", if N is not "0",the program flow goes to the step 713, the motor MO1 is driven at arotation speed of 1,000 rpm. On the other hand, if the encoder pulsecount number N is "0", the motor MO1 is stopped at the step 710, andthen, it is judged whether or not the one shot AF flag OAFF is "1" atthe step 711. If the one shot AF mode is set, or the flag OAFF is "1",the microcomputer MCOM waits for the interrupt signal inputted into theinterrupt terminal INT or INT2 at the step 714, without performing thenext distance measurement. On the other hand, if the one shot AF mode isnot arranged, or the flag OAFF is "0", the program flow returns to themain routine at the step 712.

As described above, in the first preferred embodiment, the auxiliarylight mode is continuously arranged after the auxiliary light mode flagALMF is arranged at the step 143 until the flag ALMF is reset at thestep 208. That is, during the one shot AF mode, after the program flowenters the auxiliary light mode at the step 143, the distancemeasurement with the auxiliary light is performed until it is judgedthat the photograph lens is in the in-focus range, except when the flagALMF is canceled at the step 208.

During the continuous AF mode, the distance can be correctly measured ata quick response when the auxiliary light mode is arranged. Thecancellation of the auxiliary light mode is judged by the AGC data andthe contrast value at the preliminary integration, resulting in that thejudgment of the auxiliary light mode can be efficiently performedwithout a long cycle of the distance measurement.

Moreover, in the low contrast search, the speed of the motor MO1 and theperiod of lighting of the auxiliary light are changed by the conversionfactor K, resulting in that the distance can be correctly measured at alow power consumption. Lighting of the auxiliary light is inhibitedduring the low contrast search inhibition time, resulting in that theauxiliary light can be prevented from lighting unnecessarily, andunpleasant feeling for the photographer of the object can be reduced.

FIG. 5 shows another example of performing the ΔIR correction. Acontrast Cmix converted by the integration time 20 msec of the imagesensor and AGC X 1 under the auxiliary light emission is calculated inthe steps 502 and 503. The result of the calculation is subtracted by acontrast Cfix which is obtained by a fixed pattern of the image sensor.The contrast Cfix due to the fixed pattern of the image sensor isproduced by dispersion of the each pixell of the image sensor and theoutput thereof representing the dark current and not by the contrast ofthe object. Thus, an accurate contrast data can be obtained by thesubtraction of Cmix-Cfix. The value Cfix may be a standard value whichis obtained by the image sensor used. The contrast CONTST for theambient light with respect to the integration time 20 msec. and AGC X 1may be obtained in the steps 505 and 506 and the result is subtracted byCfix in the step 507. The the color aberration ΔIR₇₀₀ on the axis forthe light of wave length 700 nm is calculated in the step 508, then thecolor aberration on the axis for the mixed light is obtained using thecontrast Cmix under the auxiliary light and the contrast Cdl under theambient light in the step 509. Subsequently, the true defocus value canbe obtained in the step 510 by subtracting the ΔIRmix₇₀₀ from thedetected defocus value. By the calculation mentioned above, it ispossible to improve the accuracy of the defocus value decreasing theeffect of the contrast of the fixed pattern of the image sensor.

Moreover, in place of the contrast, the output of the image sensor suchas the peak data of the output of the image sensor may be used in theprocess as shown in FIGS. 17 to 19. In this case, the contrast Cmix maybe replaced by the peak data Pmix as shown in the steps 402', 403', 404'405' and 407' in FIG. 19 and the peak data is saved in the RAM as PST asshown in the steps 2061' in FIG. 17, 1313'0 in FIG. 18.

In the embodiment, the auxiliary light device AL is enclosed in theelectric flash device FS, however, the present invention is not limitedto this, the auxiliary light device AL may be arranged outside of themain body BD of the camera. Moreover, the auxiliary light device AL maybe arranged in the main body BD of the camera behind the photographlens, as described in the Japanese patent laid open No. 208512/1984, andin this case, the light beam of the auxiliary light passes through thephotograph lens and reaches the object.

In case the release button (not shown) of the camera is fully depressed,a release switch S2 is turned on, so that an exposure operation startsaccording to the result of the exposure calculation, AF control mode andfocus condition of the lens. However, such operation is not directlyrelated to the present invention and the details is herein omitted.

                  TABLE 1                                                         ______________________________________                                        AFMTB   AFMTR    AFMTF      Control of Motor MO1                              ______________________________________                                        1       0        0          Brake                                             0       1        0          Clockwise rotation                                0       0        1          Counterclockwise rotation                         0       0        0          Stop                                              ______________________________________                                    

                  TABLE 2                                                         ______________________________________                                        MM      MN           Control of Motor MO2                                     ______________________________________                                        0       1            Brake                                                    1       0            Clockwise rotation                                       0       0            Counterclockwise rotation                                1       1            Stop                                                     ______________________________________                                    

                  TABLE 3                                                         ______________________________________                                        Condition                                                                             Mode       Operation        Terminal                                  ______________________________________                                        S3 OFF  One shot   Only one exposure                                                                              P60←H                                                   during switch S2 on                                        S3 ON   Continuous Continuous exposure                                                                            P60←L                                        shot       during switch S2 on                                        S4 OFF  AF priority                                                                              Inhibit exposure until                                                                         P61←H                                                   in-focus attainment                                                           even though switch S2 on                                   S4 ON   Release    Exposure start independent                                                                     P61←L                                        priority   of focus condition                                                            if switch S2 on                                            S5 OFF  One shot AF                                                                              Inhibit automatic focus                                                                        P62←H                                                   operation locking lens                                                        in case switch S2 is on                                                       and in focus is attained                                                      after automatic focus                                                         operation start                                            S5 ON   Continuous Always automatic focus                                                                         P62←L                                        AF         operation during S2 on                                     ______________________________________                                    

                  TABLE 4                                                         ______________________________________                                                 Initial                                                              Flag     value   Condition Content                                            ______________________________________                                        Auxiliary                                                                              0       1         Distance measurement                               light                      with auxiliary light                               mode flag        0         Distance measurement                                                          with ambient light                                 Low contrast                                                                           0       1         Inhibit low contrast search                        search inhibit   0         Permit low contrast search                         flag                                                                          High speed                                                                             0       1         Motor MO1 rotation                                 flag                       at high speed                                                       0         Motor MO1 rotation                                                            at low speed or stop                               In-focus flag                                                                          0       1         In-focus position of lens                                           0         Out-of-focus position of lens                      Low contrast                                                                           0       1         In low contrast search                             searching flag   0         Not in low contrast search                         LS flag  1       1         First time of extreme                                                         position detection                                                  0         Second time of extreme                                                        position detection                                 ______________________________________                                    

What is claimed is:
 1. An automatic focus control device for use in acamera, comprising:a photographic lens; light receiving means includinga plurality of photocells which receives light passing through saidphotographic lens from an object; focus condition detecting means fordetecting a focus condition of said photographic lens based on theoutput of said light receiving means and calculating the amount ofdefocus of said photographic lens; auxiliary light emitting means foremitting auxiliary light to said object; comparing means for comparingthe output of said light receiving means under the auxiliary lightemission and ambient light with the output of said light receiving meansunder the ambient light; and means for correcting the detected defocusamount under the auxiliary light emission and ambient light inaccordance with the result of said comparison.
 2. An automatic focuscontrol device according to claim 1, wherein said comparing meanscompares the peak data of the output of said light receiving means underthe auxiliary light emission with ambient light and the peak data ofoutput of said light receiving means under ambient light.
 3. Anautomatic focus control device according to claim 1, wherein saidcorrecting means calculates

    ΔIRλmix=ΔIRλX (1-Pdl/Pmix)

wherein ΔIRλ is the color aberration on the lens axis for the auxiliarylight with the wave length λ, Pdl is a peak data under the ambient lightand Pmix is a peak data under the auxiliary light emission and ambientlight.
 4. An automatic focus control device according to claim 3,wherein said correcting means comprises calculation means forcalculating a correction value ΔIRλ by the color aberration on the axisof a photographic lens under a specific wave length, and the values ofthe specific wave length, wave length of the auxiliary light and wavelength of the standard wave length.
 5. An automatic focus control deviceaccording to claim 4, wherein the value of ΔIRλ is stored in theinterchangeable lens and is transferred to the camera body.
 6. Anautomatic focus control device for use in a camera, comprising:aphotographic lens; light receiving means including a plurality ofphotocells which receives light passing through said photographic lensfrom an object; contrast detecting means for detecting the contrast ofthe object based on the output of said light receiving means; focuscondition detecting means for detecting a focus condition of saidphotographic lens based on the output of said light receiving means andcalculating the amount of defocus of said photographic lens; auxiliarylight emitting means for emitting auxiliary light to said object;comparing means for comparing the output of said contrast detectingmeans under the auxiliary light emission and ambient light with theoutput of said contrast detecting means under the ambient light; andmeans for correcting the detecting defocus amount under the auxiliarylight emission and ambient light in accordance with the result of saidcomparison.
 7. An automatic focus control device according to claim 6,wherein said correcting means calculates

    ΔIRλmix=ΔIRλ×(1-Cdl/Cmix)

wherein ΔIRλ is the color aberration on the lens axis for the auxiliarylight with the wave length λ, Cdl is a contrast under ambient lightalone without auxiliary light, and Cmix is the contrast under ambientlight with auxiliary light.
 8. An automatic focus control deviceaccording to claim 7, wherein the values Cmix and Cdl are respectivelysubtracted by a contrast occurring by the dispersion of the property ofthe light receiving element.
 9. An automatic focus control deviceaccording to claim 7 wherein said correcting means comprises calculationmeans for calculating a correction value ΔIRλ by the color aberration onthe axis of a photographic lens under a specific wave length, and thevalues of the specific wave length, wave length of the auxiliary lightand wave length of the standard wave length.
 10. An automatic focuscontrol device according to claim 9, wherein said calculating meanscalculates the value ΔIRλ by the equation

    ΔIRλ=ΔIRλfix X(λ-λd)/(λfix-λd)

wherein λ is the wave length of the auxiliary light, λd is the wavelength of the standard light, λfix is the specific wave length and ΔIRλis the color aberration on the axis under the specific wave length. 11.An automatic focus control device according to claim 10, wherein theΔIλfix is stored in the interchangeable lens and is transferred to thecamera body.
 12. An automatic focus control device for use in a cameracomprising;a photographic lens; light receiving means including aplurality of photocells which receives light passing through saidphotographic lens from an object for producing an output indicative ofthe received light; focus condition detecting means for detecting afocus condition of said photographic lens based on the output of saidlight receiving means and calculating the amount of defocus of saidphotographic lens; auxiliary light emitting means for emitting auxiliarylight to illuminate said object; first storing means for storing a firstvalue of the output of said light receiving means under a firstillumination having a first wave length; second storing means forstoring a second value of the, output of said light receiving meansunder a second light condition having a second wave length differentfrom the first wave length; comparing means for comparing the firstvalue stored in said first storing means with said second value storedin said second storing means; and means for correcting the detecteddefocus amount under the auxiliary light emission and ambient light inaccordance with the result of said comparison.
 13. An automatic focuscontrol device according to claim 12, wherein said comparing meanscompares the peak value of the first value stored in said first storingmeans with the peak value of the second value stored in said secondstoring means.
 14. An automatic focus control device for use in acamera, comprising:a photographic lens; light receiving means includinga plurality of photocells which receives light passing through saidphotographic lens from an object for producing an output indicative ofthe received light; contrast detecting means for detecting the contrastof the object based on the output of said light receiving means; focuscondition detecting means for detecting a focus condition of saidphotographic lens based on the output of said light receiving means andfor calculating the amount of defocus of said photographic lens;auxiliary light emitting means for emitting auxiliary light to saidobject; comparing means for comparing an output of said contrastdetecting means under a first light condition having a first wave lengthwith the output of said contrast detecting means under a second lightcondition having a second wave length different from the first wavelength; and means for correcting the detected defocus amount under theauxiliary light emission and ambient light in accordance with the resultof said comparison.